﻿using TimeSpan.Services;

namespace TimeSpan.Views.Pages;

public partial class HomeViewModel(WorkflowService workflow) : ObservableObject {

    [RelayCommand]
    private void CreateNew() {
        workflow.NewTask.OnNext(null);
    }

    [RelayCommand]
    private void PreStart(string settingName) {

        var option = new SpanTaskOption() { 
            Title = $"FastTask {DateTime.Now:yyyy/MM/dd HH:mm}",
            BlockDuration = 25,
            TotalDuration = settingName == "setting1" ? 60 : 90,
        };

        workflow.PreStartTask.OnNext(option);
    }

}